﻿@model List<BeYourMarket.Model.Models.ListingReview>
@using Microsoft.AspNet.Identity

@{
    Layout = null;
}

<div id="reviewList">
    <div class="row">
        <div class="col-md-12 section-title ">
            <h4><i class="fa fa-star"></i> [[[Reviews]]] (@Model.Count)</h4>
        </div>
    </div>

    @foreach (var review in Model)
    {
        var ratingClass = "s" + review.Rating * 2;
        <div class="row text-center-sm">
            <div class="col-md-2 col-xs-12">
                <a href="@Url.Action("Profile", "Listing", new { id = review.AspNetUserFrom.Id })">
                    <img class="img-circle thumb-sm m-r-5" src="@BeYourMarket.Web.Utilities.ImageHelper.GetUserProfileImagePath(review.AspNetUserFrom.Id)" />
                </a>
                <p><a class="text-xs" href="@Url.Action("Profile", "Listing", new { id = review.AspNetUserFrom.Id })">@review.AspNetUserFrom.FullName</a></p>
            </div>
            <div class="col-md-10 col-xs-12">
                <span class="score @ratingClass"></span>
                <p class="text-sm">@review.Description</p>
                <small class="text-lighten">@review.Created.ToShortDateString()</small>
            </div>

        </div>

        <hr />
    }

    @if (!Model.Any())
    {
        <p>[[[There is no review yet.]]]</p>
    }    
</div>
